<template>
  <div>
    <h2 style="float: right;">列表</h2>
    <el-table :data="tableData" style="width: 100%">
    <el-table-column prop="date" label="创建时间" width="180" />
    <el-table-column prop="name" label="姓名" width="180" />
    <el-table-column prop="hao" label="账号" width="180" />
    <el-table-column prop="route" label="角色" width="180" />
    <el-table-column prop="state" label="状态" width="180" />
    <el-table-column prop="address" label="操作" >
      <template v-slot="scope">
        <el-button type="primary" >编辑</el-button>
        <el-button type="danger" >重置密码</el-button>
     <a   v-if="scope.row.route=='系统管理员'" type="warning" @click="Delete()">删除</a>
       
      </template>
    </el-table-column>
  </el-table>

  </div>
</template>

<script setup lang="ts">
import { ref ,reactive,onMounted} from 'vue'
import { ElMessage } from 'element-plus'

//生命周期
onMounted(()=>{
  show();
})
const show=()=>{

}

//删除
const Delete=()=>{
ElMessage({
  message: '确认删除吗',
  type: 'warning',
})
}




const tableData = [
  {
    date: '2016-05-03',
    name: '张三',
    hao:"zhangsan",
    route:"普通用户",
    state:"启用",
    address: 'No. 189, Grove St, Los Angeles',
  },
  {
    date: '2016-05-02',
    name: '李四',
    hao:"lisi",
    route:"普通用户",
    state:"启用",
    address: 'No. 189, Grove St, Los Angeles',
  },
  {
    date: '2016-05-04',
    name: '王二麻',
    hao:"wangerma",
    route:"普通用户",
    state:"启用",
    address: 'No. 189, Grove St, Los Angeles',
  },
  {
    date: '2016-05-01',
    name: '赵六',
    hao:"zhaoliu",
    route:"系统管理员",
    state:"禁用",
    address: 'No. 189, Grove St, Los Angeles',
  },
]

</script>

<style scoped>

</style>